<html>
<head>
    <script>
    function generateErrors(number)
    {
        for (var i = 0; i < number; ++i)
            console.error("This is an error.");
    }

    function generateLogs(number)
    {
        for (var i = 0; i < number; ++i)
            console.log("This is a log.");
    }

    function generateWarnings(number)
    {
        for (var i = 0; i < number; ++i)
            console.warn("This is a warning.");
    }

    function generateInfos(number)
    {
        for (var i = 0; i < number; ++i)
            console.info("This is an info.");
    }
    
    function startTest()
    {
        generateErrors(3);
        generateLogs(3);
        generateWarnings(3);
        
        console.group();

        generateErrors(2);
        generateLogs(1);
        generateErrors(2);

        generateLogs(2);
        generateWarnings(1);
        generateLogs(2);

        generateWarnings(2);
        generateErrors(1);
        generateWarnings(2);
        
        console.groupEnd();

        generateErrors(1);
        console.group();
        generateErrors(1);
        console.group();
        generateErrors(1);
        console.groupEnd();
        generateErrors(1);
        console.groupEnd();
        generateErrors(1);
        
        console.warn("Same message, different level");
        console.error("Same message, different level");
        console.log("Same message, different level");
        console.info("Same message, different level");
        
        console.log("Variadic message: %s", "message 1");
        console.log("Variadic message: %s", "message 2");
        console.log("Variadic message: %s", "message 3");
        console.log("Variadic message: %s", "message 4");
        
        console.warn("Warning and error on same line."); console.error("Warning and error on same line."); console.warn("Warning and error on same line."); console.error("Warning and error on same line.");
        
    }
    </script>
</head>
<body onload="startTest()">
This test generates warnings, errors, and logs to test the grouping of repeated
messages in the Web Inspector.  To check this test open the Web Inspector and see
that there are never any repeated messages that don't have a number next to them.
<br>
<br>
<input type="button" onclick="generateErrors(1)" value="Put Error in Console"></input>
<br>
<input type="button" onclick="generateLogs(1)" value="Put Log in Console"></input>
<br>
<input type="button" onclick="generateWarnings(1)" value="Put Warning in Console"></input>
</body>
